﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SnapLib
{
    public class ForeignCheckbox: ForeignControl
    {
        public ForeignCheckbox(IntPtr parentWindow, uint controlId) :
            base(parentWindow,controlId)
        {
        }

        public CheckState Checked
        {
            set
            {
                Win32.CheckDlgButton(m_parentWnd, m_controlId, value);
            }
            get
            {
                return Win32.IsDlgButtonChecked(m_parentWnd, m_controlId);
            }
        }

        public void Press()
        {
            Win32.SendMessage(m_parentWnd, WindowsMessage.WM_COMMAND, m_controlId, (uint)m_hwnd);
        }
    }
}
